package com.maserb.monitor.entity.schoolStudent;

import com.maserb.monitor.entity.BaseIdEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 *  成绩
 *  @author  jimmy
 */
@Data
@Entity
@Table(name = "student_achieve")
public class StudentAchieveEntity extends BaseIdEntity {
    /**
     * 学生
     */
    private SchoolStudentEntity student;

    /**
     * 考试期数
     */
    private String term;

    /**
     * 考试期数id
     */
    private String termId;

    /**
     * 考试时所属班级
     */
    private String clazzId;

    /**
     * 本次考试总分
     */
    private Double totalScore;

    /**
     * 本次考试平均分
     */
    private Double avgScore;

    /**
     * 班级排名
     */
    private Integer clazzRank;

    /**
     * 城市排名
     */
    private Integer cityRank;

    /**
     * 本次考试科目数
     */
    private Integer subjectCount;

    /**
     * 该学生成绩是否计入班级平均分
     */
    private String isCountAvg;

    private String createUser;

    private Date createTime;

    private String updateUser;

    private Date updateTime;

    private String fmtCreateTime;

    private List<StudentScoreEntity> scoreList;

    private Double score;

    private String description;

    private String subjectName;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "student_id")
    public SchoolStudentEntity getStudent() {
        return student;
    }

    public void setStudent(SchoolStudentEntity student) {
        this.student = student;
    }

    @Column(name = "term")
    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    @Column(name = "create_user", length = 50)
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "update_user", length = 50)
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "clazz_id", length = 36)
    public String getClazzId() {
        return clazzId;
    }

    public void setClazzId(String clazzId) {
        this.clazzId = clazzId;
    }

    @Column(name = "total_score")
    public Double getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Double totalScore) {
        this.totalScore = totalScore;
    }

    @Column(name = "avg_score")
    public Double getAvgScore() {
        return avgScore;
    }

    public void setAvgScore(Double avgScore) {
        this.avgScore = avgScore;
    }

    @Column(name = "subject_count")
    public Integer getSubjectCount() {
        return subjectCount;
    }

    public void setSubjectCount(Integer subjectCount) {
        this.subjectCount = subjectCount;
    }

    @Transient
    public String getFmtCreateTime() {
        return fmtCreateTime;
    }

    public void setFmtCreateTime(String fmtCreateTime) {
        this.fmtCreateTime = fmtCreateTime;
    }

    @Transient
    public List<StudentScoreEntity> getScoreList() {
        return scoreList;
    }

    public void setScoreList(List<StudentScoreEntity> scoreList) {
        this.scoreList = scoreList;
    }

    @Transient
    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    @Transient
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Transient
    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    @Column(name = "term_id")
    public String getTermId() {
        return termId;
    }

    public void setTermId(String termId) {
        this.termId = termId;
    }

    @Column(name = "clazz_rank", length = 5)
    public Integer getClazzRank() {
        return clazzRank;
    }

    public void setClazzRank(Integer clazzRank) {
        this.clazzRank = clazzRank;
    }

    @Column(name = "city_rank", length = 8)
    public Integer getCityRank() {
        return cityRank;
    }

    public void setCityRank(Integer cityRank) {
        this.cityRank = cityRank;
    }

    @Column(name = "is_count_avg", length = 2)
    public String getIsCountAvg() {
        return isCountAvg;
    }

    public void setIsCountAvg(String isCountAvg) {
        this.isCountAvg = isCountAvg;
    }
}